<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<!--Generated on Mon Oct 27 10:49:32 2014 by LaTeXML (version 0.7.999_04) http://dlmf.nist.gov/LaTeXML/.-->

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../../LaTeXML.css" type="text/css">
<link rel="stylesheet" href="../../../../../../ltx-article.css" type="text/css">
<link rel="stylesheet" href="../../../../../../customRules.css" type="text/css">
</head>
<body>
<div class="ltx_page_main">
<div class="ltx_page_content">
<div class="ltx_document">
<div id="Sx1" class="ltx_section">
<h1 class="ltx_title ltx_title_section">Filtering according to a user-defined criteria</h1>

<div id="Sx1.p1" class="ltx_para">
<p class="ltx_p">ThunderSTORM can remove unwanted molecules according to a user-defined
criteria, or display molecules in a <a href="ROIselection.html" title="" class="ltx_ref">user-specified region</a>.
The filtering criteria is formulated as an expression combining mathematical
and logical functions and operators with parameters from the table
of results obtained from previous data analysis. All molecules with
parameters not accepted by the criteria are removed. Note that users
can also display histograms of particular measured parameters and
select thresholds to define the filtering criteria.</p>
</div>
<div id="Sx1.SSx1" class="ltx_subsection">
<h2 class="ltx_title ltx_title_subsection">Examples of filter formulas</h2>

<div id="Sx1.SSx1.p1" class="ltx_para">
<ul id="I1" class="ltx_itemize">
<li id="I1.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I1.i1.p1" class="ltx_para">
<p class="ltx_p"><span class="ltx_text ltx_font_typewriter">sigma &gt; 15</span></p>
</div>
</li>
<li id="I1.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I1.i2.p1" class="ltx_para">
<p class="ltx_p"><span class="ltx_text ltx_font_typewriter">frame &lt; 1000 | frame &gt; 2000</span></p>
</div>
</li>
<li id="I1.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I1.i3.p1" class="ltx_para">
<p class="ltx_p"><span class="ltx_text ltx_font_typewriter">intensity &gt; 100 &amp; uncertainty &lt; 20</span></p>
</div>
</li>
<li id="I1.i4" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I1.i4.p1" class="ltx_para">
<p class="ltx_p"><span class="ltx_text ltx_font_typewriter">(x &gt; 5000 &amp; x &lt; 10000 &amp; y &gt; 5000 &amp; y &lt; 10000)</span></p>
</div>
</li>
<li id="I1.i5" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I1.i5.p1" class="ltx_para">
<p class="ltx_p"><span class="ltx_text ltx_font_typewriter">(x-10000)^2 + (y-10000)^2
&lt; 2000^2</span></p>
</div>
</li>
</ul>
</div>
</div>
<div id="Sx1.SSx2" class="ltx_subsection">
<h2 class="ltx_title ltx_title_subsection">Formula interpreter syntax</h2>

<div id="Sx1.SSx2.p1" class="ltx_para">
<p class="ltx_p">The filtering criteria is specified as an expression combining statistical
and logical functions and operators with variables from the table
of localization results. The result of the formula must be a vector
of Boolean values containing ‘‘true’’ for each row that should stay
in the table and ‘‘false’’ for the rows that should be deleted. A
brief description of the syntax and semantic rules follows.</p>
</div>
<div id="Sx1.SSx2.SSSx1" class="ltx_subsubsection">
<h3 class="ltx_title ltx_title_subsubsection">Variables</h3>

<div id="Sx1.SSx2.SSSx1.p1" class="ltx_para">
<p class="ltx_p">Variables used in formulas can be numerical scalars or vectors, or
logical vectors. Numerical vectors are provided by columns in the
table of results. To use a column as a variable, input its name (without
square brackets with units). Any column can be used as a variable.</p>
</div>
</div>
<div id="Sx1.SSx2.SSSx2" class="ltx_subsubsection">
<h3 class="ltx_title ltx_title_subsubsection">Operators</h3>

<div id="Sx1.SSx2.SSSx2.p1" class="ltx_para">
<p class="ltx_p">Operators take variables as operands. All vector operations are performed
element-wise, therefore vectors must have the same size. The semantics
is as follows:</p>
</div>
<div id="Sx1.SSx2.SSSx2.p2" class="ltx_para">
<table class="ltx_tabular ltx_align_middle">
<tbody class="ltx_tbody">
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">scalar + scalar = scalar</span></td>
<td class="ltx_td"></td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">vector + vector = vector</span></td>
<td class="ltx_td"></td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">vector + scalar = vector</span></td>
<td class="ltx_td ltx_align_left">(scalar is added to each element of the vector)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="Sx1.SSx2.SSSx3" class="ltx_subsubsection">
<h3 class="ltx_title ltx_title_subsubsection">Arithmetical operators</h3>

<div id="Sx1.SSx2.SSSx3.p1" class="ltx_para">
<p class="ltx_p">Arithmetical operators can take numerical vectors or scalars as operands.
The behavior changes accordingly. The output is a numerical vector
if at least one of the operands is a vector, or a scalar if both operands
are scalar. The supported arithmetical operators are:</p>
</div>
<div id="Sx1.SSx2.SSSx3.p2" class="ltx_para">
<table class="ltx_tabular ltx_align_middle">
<tbody class="ltx_tbody">
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a + b</span></th>
<td class="ltx_td ltx_align_left">addition</td>
</tr>
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a - b</span></th>
<td class="ltx_td ltx_align_left">subtraction</td>
</tr>
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a * b</span></th>
<td class="ltx_td ltx_align_left">multiplication</td>
</tr>
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a / b</span></th>
<td class="ltx_td ltx_align_left">division</td>
</tr>
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a % b</span></th>
<td class="ltx_td ltx_align_left">modulo</td>
</tr>
<tr class="ltx_tr">
<th class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a ^ b</span></th>
<td class="ltx_td ltx_align_left">exponentiation (<span class="ltx_text ltx_font_typewriter">b</span> must be a scalar)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="Sx1.SSx2.SSSx4" class="ltx_subsubsection">
<h3 class="ltx_title ltx_title_subsubsection">Logical operators</h3>

<div id="Sx1.SSx2.SSSx4.p1" class="ltx_para">
<p class="ltx_p">Logical operators perform logical operations on vectors. All operations
are performed element-wise. The output is a vector of Boolean values.
The supported logical operators are:
</p>
</div>
<div id="Sx1.SSx2.SSSx4.p2" class="ltx_para">
<table class="ltx_tabular ltx_align_middle">
<tbody class="ltx_tbody">
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a &amp; b</span></td>
<td class="ltx_td ltx_align_left">logical AND</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a | b</span></td>
<td class="ltx_td ltx_align_left">logical OR</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a &lt; b</span></td>
<td class="ltx_td ltx_align_left">smaller than</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a &gt; b</span></td>
<td class="ltx_td ltx_align_left">greater than</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a = b</span></td>
<td class="ltx_td ltx_align_left">equals</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">a != b</span></td>
<td class="ltx_td ltx_align_left">not equals</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">!a</span></td>
<td class="ltx_td ltx_align_left">negation</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="Sx1.SSx2.SSSx5" class="ltx_subsubsection">
<h3 class="ltx_title ltx_title_subsubsection">Functions</h3>

<div id="Sx1.SSx2.SSSx5.p1" class="ltx_para">
<p class="ltx_p">Functions can take a numerical vector or a scalar as an argument or
a result of a function which is a numerical vector or a scalar. The
supported functions are:</p>
</div>
<div id="Sx1.SSx2.SSSx5.p2" class="ltx_para">
<table class="ltx_tabular ltx_align_middle">
<tbody class="ltx_tbody">
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">var(x)</span></td>
<td class="ltx_td ltx_align_left">variance of <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">std(x)</span></td>
<td class="ltx_td ltx_align_left">standard deviation of <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">mean(x)</span></td>
<td class="ltx_td ltx_align_left">mean value of <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">median(x)</span></td>
<td class="ltx_td ltx_align_left">median of <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">min(x)</span></td>
<td class="ltx_td ltx_align_left">minimum value in <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">max(x)</span></td>
<td class="ltx_td ltx_align_left">maximum value in <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">sum(x)</span></td>
<td class="ltx_td ltx_align_left">sum of all items in <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
<tr class="ltx_tr">
<td class="ltx_td ltx_align_left"><span class="ltx_text ltx_font_typewriter">abs(x)</span></td>
<td class="ltx_td ltx_align_left">absolute value of <span class="ltx_text ltx_font_typewriter">x</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="Sx1.SSx3" class="ltx_subsection">
<h2 class="ltx_title ltx_title_subsection">See also</h2>

<div id="Sx1.SSx3.p1" class="ltx_para">
<ul id="I2" class="ltx_itemize">
<li id="I2.i1" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I2.i1.p1" class="ltx_para">
<p class="ltx_p"><a href="Postprocessing.html" title="" class="ltx_ref">Post-processing analysis</a></p>
</div>
</li>
<li id="I2.i2" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I2.i2.p1" class="ltx_para">
<p class="ltx_p"><a href="https://code.google.com/p/thunder-storm/wiki/PostProcessing#Filter" title="" class="ltx_ref">Tutorial to create a filter expression using a histogram</a></p>
</div>
</li>
<li id="I2.i3" class="ltx_item" style="list-style-type:none;">
<span class="ltx_tag ltx_tag_itemize">•</span> 
<div id="I2.i3.p1" class="ltx_para">
<p class="ltx_p"><a href="https://code.google.com/p/thunder-storm/wiki/PostProcessing#Visualizing_and_exporting_molecular_localizations_from_a_region" title="" class="ltx_ref">Tutorial to create a filter expression by selecting a region of interest</a></p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="ltx_page_footer">
<div class="ltx_page_logo">Generated  on Mon Oct 27 10:49:32 2014 by <a href="http://dlmf.nist.gov/LaTeXML/">LaTeXML <img src="" alt="[LOGO]"></a>
</div>
</div>
</div>
</body>
</html>
